package com.chezhujie.www.enums;

import com.xy.core.init.mysql.annotation.Enum;

/**
 * 订单状态
 * Created by 汤伟杰 on 2017/6/1.
 */
@Enum(name="orderstatus",type = "select")
public enum OrderStatus {
//2017-8-23 前
UNSTART("未开始",3),UNUSE("未使用",4),USE("已使用",5),OUTOFDATE("已过期",6),//活动
    RUNNING("待支付",0),FAIL("支付失败",2),
    WAITFORRECEIVING("待收货",7),CLOSE("已关闭",9),
    //待发货的退款->取消订单中->订单已取消
    RECEIVED("已领取",11),UNRECEIVED("未领取",12),//奖品
   REFUNDFAIL("退款失败",14),
    //确认收货的退款->申请退货->退货成功（商家确认）
    REFUNDING("申请退货",16),REFUNDSUCCESS("退货退款成功",18),



//最新2017-8-23
    CONFIRMRECEIPT("已确认收货",20) ,FINENDLEASE("已结束租赁",21),STAYBACK("归还中",22),RETURNED("已归还",23),INLEASE("租赁中",24)
    ,SENDGOODSING("发货处理中",25) ,TOBUY("未购买",26),STAYINADVANCE("未预付租赁",27), FIN("购买已完成",8), SUCCESS("支付成功",1)
    ,TOSENDGOODS("已发货",13), CANSEL("取消订单中",10),REFUNDED("订单已取消",17)
    ;
    private String name;
    private int index;
    // 构造方法
    private OrderStatus(String name, int index) {
        this.name = name;
        this.index = index;
    }
    // 普通方法
    public static String getName(int index) {
        for (OrderStatus c : OrderStatus.values()) {
            if (c.getIndex() == index) {
                return c.name;
            }
        }
        return null;
    }
    // get set 方法
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public int getIndex() {
        return index;
    }
    public void setIndex(int index) {
        this.index = index;
    }
}
